package org.htmlparser.util;

import java.io.PrintStream;
import java.io.Serializable;

public class DefaultParserFeedback
  implements ParserFeedback, Serializable
{
  public static final int DEBUG = 2;
  public static final int NORMAL = 1;
  public static final int QUIET;
  protected int mMode;

  public DefaultParserFeedback()
  {
    this(1);
  }

  public DefaultParserFeedback(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 2))
      throw new IllegalArgumentException("illegal mode (" + paramInt + "), must be one of: QUIET, NORMAL, DEBUG");
    this.mMode = paramInt;
  }

  public void error(String paramString, ParserException paramParserException)
  {
    if (this.mMode != 0)
    {
      System.out.println("ERROR: " + paramString);
      if ((2 == this.mMode) && (paramParserException != null))
        paramParserException.printStackTrace();
    }
  }

  public void info(String paramString)
  {
    if (this.mMode != 0)
      System.out.println("INFO: " + paramString);
  }

  public void warning(String paramString)
  {
    if (this.mMode != 0)
      System.out.println("WARNING: " + paramString);
  }
}